package com.itheima.d09_reflect_constructor;

public class Cat {
    private String name;
    private int age;
    private Cat(){
        System.out.println("无参构造方法");
    }
    public Cat(String name, int age){
        System.out.println("有参构造方法");
        this.name = name;
        this.age = age;
    }
 private Cat(String name){
        System.out.println("有参构造方法");
        this.name = name;
    }
    public Cat(int age){
        System.out.println("有参构造方法");
        this.age = age;
    }



      @Override
    public String toString() {
        return "Cat{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

}
